package com.dgshanger.sanhxiaofeisc.mvp.model;

import com.dgshanger.sanhxiaofeisc.common.AppApi;
import com.dgshanger.sanhxiaofeisc.entity.InvoiceEntity;
import com.dgshanger.sanhxiaofeisc.mvp.contract.InvoiceAssistantContract;
import com.xx.baseutilslibrary.network.rx.RxHelper;
import com.xx.baseutilslibrary.network.rx.RxHttpObserver;

/**
 * InvoiceAssistantModel
 * 沉迷学习不能自拔
 * Describe：发票助手Model
 * Created by 雷小星🍀 on 2018/5/3 18:41.
 */

public class InvoiceAssistantModel implements InvoiceAssistantContract.Model {

    @Override
    public void myInvStore(String invoice_header, String invoice_company_name, String invoice_base_account, String invoice_bank_name, String invoice_tax_number, String invoice_register_number, String invoice_mobile, String invoice_address, RxHttpObserver<Object> httpObserver) {
        AppApi.Api()
                .my_inv_store(invoice_header, invoice_company_name, invoice_base_account, invoice_bank_name, invoice_tax_number, invoice_register_number, invoice_mobile, invoice_address)
                .compose(RxHelper.io_main())
                .subscribe(httpObserver);
    }

    @Override
    public void myInv(RxHttpObserver<InvoiceEntity> httpObserver) {
        AppApi.Api()
                .my_inv()
                .compose(RxHelper.io_main())
                .subscribe(httpObserver);
    }
}
